// PDMapCreatorDlg.h : header file
//

#pragma once

#include "db\DbProxy.h"
#include "Convertor.h"
#include "GlobalTypes.h"
#include "afxwin.h"
#include "afxcmn.h"

// CPDMapCreatorDlg dialog
class CPDMapCreatorDlg : public CDialog
{
// Construction
public:
	CPDMapCreatorDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_PDMAPCREATOR_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;
	HICON m_hIconOK;
	HICON m_hIconInvalid;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnCancel();

	DECLARE_MESSAGE_MAP()

protected:
	CDbProxy	m_mapFile;
	CConvertor	m_convertor;

	CString		m_sourceFolder;
	CString		m_targetFile;
	SourceType	m_sourceType;

	CStatic m_ctrlFileOkIcon;
	CStatic m_ctrlFolderOkIcon;
	CButton m_ctrlConvert;

	BOOL	m_fileOk;
	BOOL	m_folderOk;
	BOOL	m_formatAuto;

	int		m_totalCount;
	int		m_processedCount;

	void SaveOptions();
	void CheckParams(CheckParamMode mode = CP_ALL);
	BOOL AnalyzeFolder(CString aFolder);
	void EnableControls(BOOL enable = TRUE);

public:
	afx_msg void OnBnClickedBtnSrcFolder();
	afx_msg void OnBnClickedBtnDstFile();
	afx_msg void OnBnClickedBtnConvert();
	afx_msg void OnBnClickedBtnCreate();
	afx_msg void OnBnClickedBtnGeokuk();

	void OnThreadMessage(WPARAM wParam, LPARAM lParam);
	CProgressCtrl m_progress;
	afx_msg void OnEnChangeEdit1();
	afx_msg void OnEnChangeEdit2();
};
